package com.example.chatroom.mapper;

import com.example.chatroom.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username}")
    User getUserByName(@Param("username") String username);

    @Insert("insert into user(username,password) values(#{username},#{password})")
    Integer registry(@Param("username") String username,@Param("password") String password);
}
